<template>
  <div class="nav-bar">
    <van-nav-bar :title="title" left-arrow  @click-left="onClickLeft" fixed>
      <template #right>
        <van-icon name="search" size="20" @click="$router.push('/search')" />
      </template>
    </van-nav-bar>
  </div>
</template>
<script>
export default {
  props: {
    title: {
      default: '标题',
      type: String
    }
  },
  methods: {
    onClickLeft () {
      this.$router.back()
    }
  }
}
</script>
<style scoped>
.nav-bar::after {
  content: '';
  display: block;
  margin-top: 56px;
  height: 0;
  overflow: hidden;
}
</style>
